package org.wak.character.display
{
	import flash.display.Sprite;
	import flash.geom.Point;
	
	/**
	 * This class is for testing Scene with only a spot representing
	 * the character in a Scene. 
	 * 
	 */	
	public class TestPlayerDisplay extends AbstractCharacterDisplay
	{
				
		
		
		private var mCurrentAnim:Sprite ;
		
		private var mCurrentBehaviour:String = "";
		
		// local reference of the resource manaer
		private var mResourceMngr:Class ;
		
		// Asoc Array of anim behaviour id -> BitmapMovieClip.
		private var mBehaviours:Array = null ;
		
		private var mPrevCoordinates:Point = null ;
		
		
		private var mSpot:Sprite = null ;
		
		/**
		 * Constructor 
		 * @param pDef ICharacterDisplayDefinition with the data to create the character display.
		 * 
		 */		
		public function TestPlayerDisplay(pDef:ICharacterDisplayDefinition)
		{
			super();
			
			mSpot = new Sprite();
			mSpot.graphics.beginFill(0xFF0000);
			mSpot.graphics.drawCircle(0,0,5);
			mSpot.graphics.endFill();
			
			this.addChild( mSpot );
			
			mPrevCoordinates = new Point( this.x, this.y);
			
			mMoveSpeed = pDef.GetMoveSpeed() ;
				
		}
		
		public override function get stageX():Number
		{
			return (this.parent.x + this.x) ;
		}
		
		public override function get stageY():Number
		{
			return (this.parent.y + this.y) ;
		}
		
		public override function get dialogX():Number
		{
			return this.stageX ;
		}
		
		public override function get dialogY():Number
		{
			return (this.stageY - (mCurrentAnim.height * mCurrentAnim.scaleY * this.scaleY) - 10) ;
		}
		
		public override function get currentBehaviour():String
		{
			return mCurrentBehaviour ;
		}
		
		
		
		
		private var mAnimationSet:Boolean = false ;
		private var mOnPlayedFunc:Function = null ;
		private var mPlaysNumber:int = 1 ;
		private var mCurrentPlays:int = 0 ;
		
		
		public override function SetAnimBehaviour(pAnimBehaviour:String, pPlays:int = 1, pOnPlayed:Function = null):void
		{
			
			
			if( pAnimBehaviour == "")
				return ;
			
			
			var fNewAnim:Sprite = mSpot ;
			
			
			
			mPrevCoordinates.x = this.x ;
			mPrevCoordinates.y = this.y ;
			
			
		}

		public override function toString():String
		{
			return mDisplayId + " bl:"+ this.y ;
		}
		
		
		
			
		
		

	}
}